<?php

App::uses('Presentation', 'Presentation');

class pst_numero_subsidio extends Presentation {

    public function objectDBQuery() {
        if (isset($this->value)) {
            return array("Ruta.id IN (SELECT sr.ruta_id FROM sub_subsidios_rutas sr 
                                      JOIN sub_subsidios s ON s.id=sr.subsidio_id
                                      WHERE s.numero=" . $this->value . ")");
        }

        return array();
    }

}
